home *** CD-ROM | disk | FTP | other *** search
- /* SampleOscControl.h */
-
- #ifndef Included_SampleOscControl_h
- #define Included_SampleOscControl_h
-
- /* SampleOscControl module depends on */
- /* MiscInfo.h */
- /* Audit */
- /* Debug */
- /* Definitions */
- /* FixedPoint */
- /* 64BitMath */
- /* FastFixedPoint */
- /* ModulationSpecifier */
- /* Multisampler */
- /* EnvelopeState */
- /* Envelope */
- /* LFOGenerator */
- /* LFOListSpecifier */
- /* SampleConsts */
- /* Memory */
- /* OscillatorSpecifier */
- /* FastModulation */
- /* ErrorDaemon */
-
- #include "FixedPoint.h"
- #include "FastFixedPoint.h"
- #include "ModulationSpecifier.h"
-
- struct SampleTemplateRec;
- typedef struct SampleTemplateRec SampleTemplateRec;
-
- struct SampleStateRec;
- typedef struct SampleStateRec SampleStateRec;
-
- /* forwards */
- struct OscillatorRec;
- struct ArrayRec;
- struct ErrorDaemonRec;
-
- /* get rid of all cached memory for state or template records */
- void FlushSampleOscControl(void);
-
- /* perform one envelope update cycle */
- void UpdateSampleEnvelopes(SampleStateRec* State);
-
- /* dispose of the sample state record */
- void DisposeSampleState(SampleStateRec* State);
-
- /* dispose of the sample information template */
- void DisposeSampleTemplate(SampleTemplateRec* Template);
-
- /* create a new sample template */
- SampleTemplateRec* NewSampleTemplate(struct OscillatorRec* Oscillator,
- float EnvelopeTicksPerSecond, long SamplingRate,
- MyBoolean Stereo, MyBoolean TimeInterp, MyBoolean WaveInterp,
- struct ErrorDaemonRec* ErrorDaemon);
-
- /* create a new sample state object. */
- SampleStateRec* NewSampleState(SampleTemplateRec* Template,
- float FreqForMultisampling, float Accent1, float Accent2,
- float Accent3, float Accent4, float Loudness, float HurryUp,
- long* PreOriginTimeOut, float StereoPosition,
- float InitialFrequency);
-
- /* fix up pre-origin time for the sample state object */
- void FixUpSampleStatePreOrigin(SampleStateRec* State,
- long ActualPreOrigin);
-
- /* set a new frequency for a state object. used for portamento */
- /* and modulation of frequency (vibrato) */
- void SampleStateNewFrequency(SampleStateRec* State,
- float NewFrequencyHertz);
-
- /* send a key-up signal to one of the oscillators */
- void SampleKeyUpSustain1(SampleStateRec* State);
- void SampleKeyUpSustain2(SampleStateRec* State);
- void SampleKeyUpSustain3(SampleStateRec* State);
-
- /* restart a sample oscillator. this is used for tie continuations */
- void RestartSampleState(SampleStateRec* State,
- float NewFreqMultisampling, float NewAccent1, float NewAccent2,
- float NewAccent3, float NewAccent4, float NewLoudness,
- float NewHurryUp, MyBoolean RetriggerEnvelopes,
- float NewStereoPosition, float NewInitialFrequency);
-
- /* generate a sequence of samples (called for each envelope clock) */
- void SampleGenSamples(SampleStateRec* State,
- long SampleCount, largefixedsigned* RawBuffer);
-
- /* find out if the sample oscillator has finished */
- MyBoolean SampleIsItFinished(SampleStateRec* State);
-
- /* generate a single sample (called for modulation chains) */
- /* OutputPlace should have 1 entry for mono output or 2 entries for stereo output */
- float SampleGenOneSample(SampleStateRec* State,
- ModulationTypes* PhaseGenModulateHow,
- float* PhaseGenModulationScaling,
- float* PhaseGenModulationOrigin,
- float* PhaseGenOldValues,
- long* PhaseGenIndirectionTable,
- long NumberOfPhaseGenModulators,
- ModulationTypes* OutputModulateHow,
- float* OutputModulationScaling,
- float* OutputModulationOrigin,
- float* OutputOldValues,
- long* OutputIndirectionTable,
- long NumberOfOutputModulators,
- largefixedsigned* OutputPlace);
-
- #endif
-